#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H

#include <QWidget>

namespace Ui {
class musicSlider;
}

class musicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit musicSlider(QWidget *parent = nullptr);
    ~musicSlider();

    void renewSliderPosition(double rate);
    void moveSlider();

signals:
    void setSliderPosition(double);

protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

private:
    Ui::musicSlider *ui;

    int currentPos;     //当前宽度
    int maxWidth;       // outLine 总宽度
};

#endif // MUSICSLIDER_H
